@ GNU AS assembler header file for SCSIFS
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:49:36 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 27 June 1995

@ OSLib---efficient, type-safe, transparent, extensible,
@ register-safe API coverage of RISC OS
@ 
@ Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
@ 
@ Licence:
@ 
@    OSLib is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 1, or (at your option)
@ any later version - and this with the following clarification and
@ special exception:
@ 
@    Linking this library statically or dynamically with other modules
@ is making a combined work based on this library. Thus, the terms
@ and conditions of the GNU General Public License cover the whole
@ combination.
@ 
@    As a special exception, the copyright holders of this library
@ give you permission to link this library with independent modules
@ to produce an executable, regardless of the license terms of these
@ independent modules, and to copy and distribute the resulting
@ executable under terms of your choice, provided that you also meet,
@ for each linked independent module, the terms and conditions of the
@ license of that module. An independent module is a module which is
@ not derived from or based on this library. If you modify this
@ library, you may extend this exception to your version of the library,
@ but you are not obliged to do so. If you do not wish to do so, delete
@ this exception statement from your version.
@ 
@    OSLib is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@ GNU General Public License for more details.
@ 
@    You should have received a copy of the GNU General Public License
@ along with this programme; if not, write to the Free Software
@ Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef SCSIFS_Hdr
#  define SCSIFS_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

#  ifndef Get_FileCore
#    define Get_FileCore
#    include "oslib/FileCore.Hdr"
#  endif

@Symbols for constants
#  define SCSIFS_DriveAbsent 0x0
#  define SCSIFS_DriveUnready 0x1
#  define SCSIFS_DriveReady 0x2

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Int
SCSIFS_DriveStatus             : 


@Symbols for SWI's and SWI reason codes
.set XSCSIFS_DiscOp,0x60980
.set SCSIFS_DiscOp,0x40980

#  define SCSIFSDiscOp_Verify 0x0
   @Entry
   @  R1 = &0 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R4 = size (Int)
   @Exit
   @  R2 = next_disc_addr (FileCore_DiscAddress)
   @  R4 = unverified (Int)

#  define SCSIFSDiscOp_ReadSectors 0x1
   @Entry
   @  R1 = &1 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = data (pointer to data)
   @  R4 = size (Int)
   @Exit
   @  R2 = next_disc_addr (FileCore_DiscAddress)
   @  R3 = next_data (pointer to data)
   @  R4 = unread (Int)

#  define SCSIFSDiscOp_WriteSectors 0x2
   @Entry
   @  R1 = &2 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 -> data (data)
   @  R4 = size (Int)
   @Exit
   @  R2 = next_disc_addr (FileCore_DiscAddress)
   @  R3 -> next_data (data)
   @  R4 = unwritten (Int)

#  define SCSIFSDiscOp_ReadTrack 0x3
   @Entry
   @  R1 = &3 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = data (pointer to data)

#  define SCSIFSDiscOp_ReadId 0x3
   @Entry
   @  R1 = &3 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = data (pointer to data)

#  define SCSIFSDiscOp_WriteTrack 0x4
   @Entry
   @  R1 = &4 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 -> data (data)

#  define SCSIFSDiscOp_FormatTrack 0x4
   @Entry
   @  R1 = &4 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = &0
   @  R4 -> format (FileCore_TrackFormat)

#  define SCSIFSDiscOp_Seek 0x5
   @Entry
   @  R1 = &5 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)

#  define SCSIFSDiscOp_Restore 0x6
   @Entry
   @  R1 = &6 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)

#  define SCSIFSDiscOp_ReadSectorsViaCache 0x9
   @Entry
   @  R1 = &9 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = data (pointer to data)
   @  R4 = size (Int)
   @  R6 = cache_handle (Int)
   @Exit
   @  R2 = next_disc_addr (FileCore_DiscAddress)
   @  R3 = next_data (pointer to data)
   @  R4 = unread (Int)
   @  R6 = cache_handle_out (Int)

#  define SCSIFSDiscOp_Specify 0xf
   @Entry
   @  R1 = &F :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)

.set XSCSIFS_Drives,0x60982
.set SCSIFS_Drives,0x40982
   @Exit
   @  R0 = default_drive (Int)
   @  R1 = floppy_count (Int)
   @  R2 = hard_disc_count (Int)

.set XSCSIFS_FreeSpace,0x60983
.set SCSIFS_FreeSpace,0x40983
   @Entry
   @  R0 -> disc_name (String)
   @Exit
   @  R0 = free (Int)
   @  R1 = max (Int)

.set XSCSIFS_DescribeDisc,0x60985
.set SCSIFS_DescribeDisc,0x40985
   @Entry
   @  R0 -> disc_name (String)
   @  R1 = disc (pointer to FileCore_Disc)

.set XSCSIFS_TestReady,0x60986
.set SCSIFS_TestReady,0x40986
   @Entry
   @  R1 = drive_no (Int)
   @Exit
   @  R0 = status (SCSIFS_DriveStatus)

.set XSCSIFS_TestMounted,0x60987
.set SCSIFS_TestMounted,0x40987
   @Exit
   @  R0 = flags (Bits)

.set XSCSIFS_MiscOp,0x6098c
.set SCSIFS_MiscOp,0x4098c

.set XSCSIFS_SectorDiscOp,0x6098d
.set SCSIFS_SectorDiscOp,0x4098d

.set XSCSIFS_FreeSpace64,0x60992
.set SCSIFS_FreeSpace64,0x40992
   @Entry
   @  R0 -> disc_name (String)
   @Exit
   @  R0 = free_lo (Bits)
   @  R1 = free_hi (Int)
   @  R2 = max (Int)

#endif
